#ifndef __LOG_H__
#define __LOG_H__

#include <string>


#include <boost/thread/mutex.hpp>
//#include <boost/thread/thread.hpp>


#define INFO_LOG 0

using namespace std;

class CLog
{
public:
	CLog();
	~CLog();

	bool Open(const char* pcFileName);
	void Close();
	void Print(const int iLevel,const char *pcFormat,...);

private:
	void _PrintConsole(const char *pcBuf,int iLen);
	void _PrintFile(const char *pcBuf,int iLen);

private:
	string _strFileName;
	//int _iFileDesc;
	//int _iFlags;
	//int _iMode;

	FILE* _pfileLog;

	boost::mutex _mutMutex;

};

#endif //__LOG_H__